package com.glacier.framework.component.dto.response;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Collection;

/**
 * date 2023-12-21 13:58
 *
 * @author glacier
 * @version 1.0
 */
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
public class PageResponse<T> extends Response<Collection<T>> {

    /**
     * 当前页
     */
    private int pageIndex;

    /**
     * 每页显示条数
     */
    private int pageSize;

    /**
     * 总数
     */
    private long total;


    public PageResponse() {
        this(1, 10, 0L);
    }

    public PageResponse(int pageIndex, int pageSize) {
        this(pageIndex, pageSize, 0L);
    }

    public PageResponse(int pageIndex, int pageSize, long total) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.total = total;
    }
}
